@import url(https://fonts.googleapis.com/css?family=Kavoon%7CWendy%2BOne%7CBonbon);
html {
  box-sizing: border-box;
  font-size: 62.5%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}
*:before, *:after {
  box-sizing: inherit;
}

body {
  width: 100%;
  height: 100vh;
  background-color: #222;
  font-family: sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}

.wrapper {
  position: relative;
  display: flex;
  gap: 40px;
}
.wrapper .element {
  position: relative;
  width: 100px;
  height: 100px;
  display: block;
  transform: rotate(315deg);
  overflow: hidden;
}
.wrapper .element:nth-of-type(1) {
  font-family: Kavoon;
}
.wrapper .element:nth-of-type(2) {
  font-family: Wendy One;
}
.wrapper .element:nth-of-type(3) {
  font-family: Bonbon;
}
.wrapper .element .content {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 20px;
  background-color: #685752;
}
.wrapper .element .content .text {
  color: #fff;
  font-weight: normal;
  transform: rotate(45deg);
  font-size: 2em;
  text-transform: uppercase;
}
.wrapper .element::before, .wrapper .element::after {
  content: "";
  position: absolute;
  right: 0;
}
.wrapper .element::before {
  width: 100%;
  height: 2px;
  background-image: linear-gradient(90deg, transparent, greenyellow);
  transform: translateX(-100%);
  animation: animateBefore calc(var(--total, 4) * 1s) linear infinite;
  animation-delay: calc(var(--i) * 1s);
}
.wrapper .element::after {
  width: 2px;
  height: 100px;
  background-image: linear-gradient(180deg, transparent, greenyellow);
  transform: translateY(-100%);
  animation: animateAfter calc(var(--total, 4) * 1s) linear infinite;
  animation-delay: calc(var(--i) * 1s);
}

@keyframes animateBefore {
  0% {
    transform: translateX(-100%);
  }
  20%, 100% {
    transform: translateX(100%);
  }
}
@keyframes animateAfter {
  0%, 12.5% {
    transform: translateY(-100%);
  }
  37.5%, 100% {
    transform: translateY(100%);
  }
}